package com.smarttiger.zero.admin.dao;

import com.smarttiger.zero.admin.entity.LogicModel;
import com.smarttiger.zero.admin.entity.TaskLogicModel;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface TaskLogicDao extends BaseDao<TaskLogicModel> {

    @Query("select lm from TaskLogicModel tl " +
            "left join LogicModel lm on tl.logicId = lm.id " +
            "where tl.taskId = ?1 " +
            "order by tl.sort ")
    public List<LogicModel> getLogicByTaskId(String id);

    public List<TaskLogicModel> getTaskLogicModelByTaskId(String id);
}
